import pygame

def InitFG(paldir):
    #Load foreground graphics
    blue            = pygame.image.load(paldir + "blue.png")
    green           = pygame.image.load(paldir + "green.png")
    cyan            = pygame.image.load(paldir + "cyan.png")
    red             = pygame.image.load(paldir + "red.png")
    purple          = pygame.image.load(paldir + "purple.png")
    yellow          = pygame.image.load(paldir + "yellow.png")
    white           = pygame.image.load(paldir + "white.png")
    black           = pygame.image.load(paldir + "black.png")
    gray            = pygame.image.load(paldir + "gray.png")
    darkblue        = pygame.image.load(paldir + "darkblue.png")
    darkgreen       = pygame.image.load(paldir + "darkgreen.png")
    darkcyan        = pygame.image.load(paldir + "darkcyan.png")
    darkred         = pygame.image.load(paldir + "darkred.png")
    darkpurple      = pygame.image.load(paldir + "darkpurple.png")
    darkyellow      = pygame.image.load(paldir + "darkyellow.png")
    darkgray        = pygame.image.load(paldir + "darkgray.png")
    
    return blue, green, cyan, red, purple, yellow, white, black, gray, darkblue, darkgreen, darkcyan, darkred, darkpurple, darkyellow, darkgray
    
def InitBG(paldir):
    colors = open(paldir + "colors.txt", "r")
    temp = colors.readline()
    bgblue          = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bggreen         = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgcyan          = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgred           = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgpurple        = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgyellow        = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgwhite         = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgblack         = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkblue      = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkgreen     = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkcyan      = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkred       = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkpurple    = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkyellow    = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bggray          = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    temp = colors.readline()
    bgdarkgray      = (int(temp[0:2], 16), int(temp[2:4], 16), int(temp[4:6], 16), int(temp[6:8], 16))
    colors.close()
    return bgblue, bggreen, bgcyan, bgred, bgpurple, bgyellow, bgwhite, bgblack, bggray, bgdarkblue, bgdarkgreen, bgdarkcyan, bgdarkred, bgdarkpurple, bgdarkyellow, bgdarkgray